/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author kheirarahali
 */
@Entity
@Table(name = "Product")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Product.findAll", query = "SELECT p FROM Product p"),
    @NamedQuery(name = "Product.findByIdProduct", query = "SELECT p FROM Product p WHERE p.idProduct = :idProduct"),
    @NamedQuery(name = "Product.findByNom", query = "SELECT p FROM Product p WHERE p.nom = :nom"),
    @NamedQuery(name = "Product.findByPrenom", query = "SELECT p FROM Product p WHERE p.prenom = :prenom"),
    @NamedQuery(name = "Product.findByPrix", query = "SELECT p FROM Product p WHERE p.prix = :prix"),
    @NamedQuery(name = "Product.findByDescription", query = "SELECT p FROM Product p WHERE p.description = :description"),
    @NamedQuery(name = "Product.findByCVidCV", query = "SELECT p FROM Product p WHERE p.cVidCV = :cVidCV"),
    @NamedQuery(name = "Product.findByProductStorereference", query = "SELECT p FROM Product p WHERE p.productStorereference = :productStorereference"),
    @NamedQuery(name = "Product.findByEtat", query = "SELECT p FROM Product p WHERE p.etat = :etat"),
    @NamedQuery(name = "Product.findByCategorieidCategorie", query = "SELECT p FROM Product p WHERE p.categorieidCategorie = :categorieidCategorie"),
    @NamedQuery(name = "Product.findByCommandeidCommande", query = "SELECT p FROM Product p WHERE p.commandeidCommande = :commandeidCommande")})
public class Product implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idProduct")
    private Integer idProduct;
    @Column(name = "nom")
    private String nom;
    @Column(name = "prenom")
    private String prenom;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "prix")
    private Double prix;
    @Column(name = "description")
    private String description;
    @Column(name = "CV_idCV")
    private Integer cVidCV;
    @Column(name = "ProductStore_reference")
    private Integer productStorereference;
    @Column(name = "etat")
    private String etat;
    @Column(name = "Categorie_idCategorie")
    private Integer categorieidCategorie;
    @Column(name = "Commande_idCommande")
    private Integer commandeidCommande;

    public Product() {
    }

    public Product(Integer idProduct) {
        this.idProduct = idProduct;
    }

    public Integer getIdProduct() {
        return idProduct;
    }

    public void setIdProduct(Integer idProduct) {
        this.idProduct = idProduct;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public Double getPrix() {
        return prix;
    }

    public void setPrix(Double prix) {
        this.prix = prix;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getCVidCV() {
        return cVidCV;
    }

    public void setCVidCV(Integer cVidCV) {
        this.cVidCV = cVidCV;
    }

    public Integer getProductStorereference() {
        return productStorereference;
    }

    public void setProductStorereference(Integer productStorereference) {
        this.productStorereference = productStorereference;
    }

    public String getEtat() {
        return etat;
    }

    public void setEtat(String etat) {
        this.etat = etat;
    }

    public Integer getCategorieidCategorie() {
        return categorieidCategorie;
    }

    public void setCategorieidCategorie(Integer categorieidCategorie) {
        this.categorieidCategorie = categorieidCategorie;
    }

    public Integer getCommandeidCommande() {
        return commandeidCommande;
    }

    public void setCommandeidCommande(Integer commandeidCommande) {
        this.commandeidCommande = commandeidCommande;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProduct != null ? idProduct.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Product)) {
            return false;
        }
        Product other = (Product) object;
        if ((this.idProduct == null && other.idProduct != null) || (this.idProduct != null && !this.idProduct.equals(other.idProduct))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Product[ idProduct=" + idProduct + " ]";
    }
    
}
